<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>注册</title>
    <base href="http://localhost:8080/">
</head>
<body>
<form action="register" method="post">
    <label for="username">
        登录名
        <input type="text" name="username" id="username" oninput="testUsername">
    </label>
    <label for="username">
        密码
        <input type="password" name="password" id="password">
    </label>
    <label for="username">
        邮箱
        <input type="email" name="email" id="email">
    </label>
    <button type="submit">提交</button>
</form>

<script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>

<script>
   function testUsername(e){
       console.log("jian");
       console.log(e.target.value);
   }
</script>
</body>
</html>